package com.dbsop.domain.transport.query;

import com.dbsop.common.enums.FlagConnect;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;

public class LikeQuery extends ConditionQuery {

    private String value;

    public LikeQuery(String columnName, String value) {
        super(columnName);
        this.value = value;
    }

    public LikeQuery(String columnName, FlagConnect flagConnect, String value) {
        super(columnName, flagConnect);
        this.value = value;
    }

    @Override
    public QueryBuilder extractBoolQuery() {
        return QueryBuilders.wildcardQuery(getColumnName(), value);
    }

}
